package main

import "fmt"

type Human struct {
	name string
	sex  string
}

func (human Human) Eat() {
	fmt.Println("Human eat....")
}

func (human Human) Walk() {
	fmt.Println("Human walk....")
}

type SuperMan struct {
	Human //SuperMan 集成Human

	level int
}

/*
*
覆盖继承方法
*/
func (superMan SuperMan) Eat() {
	fmt.Println("SuperMan eat....")
}

func (superMan SuperMan) Show() {
	fmt.Println("name", superMan.name)
	fmt.Println("sex", superMan.sex)
	fmt.Println("level", superMan.level)
}

func main() {
	h := Human{"zhangsan", "female"}
	h.Eat()
	h.Walk()

	//s := SuperMan{Human{"lisi4", "female"}, 10}
	var s SuperMan
	s.name = "lisi4"
	s.sex = "female"
	s.level = 44
	s.Walk()
	s.Eat()
	s.Show()
}
